/**
 * 
 */
package mdb.com.vn.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;



/**
 * @author tu.dod
 *
 */
@Entity
@Table(name="IFTB_LOANS")
@NamedQueries({
	@NamedQuery(name = "Loans.findByPersionalType", query = "SELECT c FROM Loans c WHERE c.customerType = :customerType"),
	@NamedQuery(name = "Loans.findByCorporateType", query = "SELECT c FROM Loans c WHERE c.customerType = :customerType"),
	@NamedQuery(name = "Loans.findByStatus", query = "SELECT c FROM Loans c WHERE c.status = :status"),
	@NamedQuery(name = "Loans.sumAmount", query = "SELECT sum(c.prAmount) FROM Loans c WHERE c.status = :status"),
	@NamedQuery(name = "Loans.findByPDateStatus", query = "SELECT c FROM Loans c WHERE c.status = :status AND c.processDate = :processDate")
})
//@NamedNativeQuery(name ="SP_GENARATE_LDR_LOANS",query="CALL mdbpks_bpro_services.pr_generate_lkd_period(:createdBy,:processDate)")
public class Loans implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	private long id;
	
	@Column(name="BRANCH_CODE")
	private String branchCode;

	@Column(name="CATEGORY")
	private String category;

	@Column(name="CCY")
	private String ccy;

	@Column(name="CREATED_BY")
	private String createdBy;

	@Temporal(TemporalType.DATE)
	@Column(name="CREATED_DATE")
	private Date createdDate;

	@Column(name="CUSTOMER_ID")
	private String customerId;

	@Column(name="CUSTOMER_NAME")
	private String customerName;

	@Column(name="CUSTOMER_TYPE")
	private int customerType;

	@Column(name="DAO")
	private String dao;

	@Column(name="INTEREST_RATE")
	private double interestRate;

	@Column(name="LKD_NUM")
	private int lkdNum;

	@Column(name="LOAN_PURPOSE")
	private String loanPurpose;

	@Temporal(TemporalType.DATE)
	@Column(name="MATURITY_DATE")
	private Date maturityDate;

	@Column(name="ON_UNDER_IND")
	private int onUnderInd;

	@Column(name="PR_AMOUNT")
	private BigDecimal prAmount;

	@Temporal(TemporalType.DATE)
	@Column(name="PROCESS_DATE")
	private Date processDate;

	@Column(name="REF_NO")
	private String refNo;

	@Column(name="STATUS")
	private String status;

	@Column(name="SUB_PRODUCTCODE")
	private String subProductcode;

	@Column(name="TERM")
	private String term;

	@Column(name="TXN_DESC")
	private String txnDesc;

	@Column(name="UPDATED_BY")
	private String updatedBy;

	@Temporal(TemporalType.DATE)
	@Column(name="UPDATED_DATE")
	private Date updatedDate;

	@Temporal(TemporalType.DATE)
	@Column(name="VALUE_DATE")
	private Date valueDate;

	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the branchCode
	 */
	public String getBranchCode() {
		return branchCode;
	}

	/**
	 * @param branchCode the branchCode to set
	 */
	public void setBranchCode(String branchCode) {
		this.branchCode = branchCode;
	}

	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}

	/**
	 * @param category the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}

	/**
	 * @return the ccy
	 */
	public String getCcy() {
		return ccy;
	}

	/**
	 * @param ccy the ccy to set
	 */
	public void setCcy(String ccy) {
		this.ccy = ccy;
	}

	/**
	 * @return the createdBy
	 */
	public String getCreatedBy() {
		return createdBy;
	}

	/**
	 * @param createdBy the createdBy to set
	 */
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	/**
	 * @return the createdDate
	 */
	public Date getCreatedDate() {
		return createdDate;
	}

	/**
	 * @param createdDate the createdDate to set
	 */
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	/**
	 * @return the customerId
	 */
	public String getCustomerId() {
		return customerId;
	}

	/**
	 * @param customerId the customerId to set
	 */
	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	/**
	 * @return the customerName
	 */
	public String getCustomerName() {
		return customerName;
	}

	/**
	 * @param customerName the customerName to set
	 */
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}



	/**
	 * @return the customerType
	 */
	public int getCustomerType() {
		return customerType;
	}

	/**
	 * @param customerType the customerType to set
	 */
	public void setCustomerType(int customerType) {
		this.customerType = customerType;
	}

	/**
	 * @return the dao
	 */
	public String getDao() {
		return dao;
	}

	/**
	 * @param dao the dao to set
	 */
	public void setDao(String dao) {
		this.dao = dao;
	}

	/**
	 * @return the interestRate
	 */
	public double getInterestRate() {
		return interestRate;
	}

	/**
	 * @param interestRate the interestRate to set
	 */
	public void setInterestRate(double interestRate) {
		this.interestRate = interestRate;
	}

	/**
	 * @return the lkdNum
	 */
	public int getLkdNum() {
		return lkdNum;
	}

	/**
	 * @param lkdNum the lkdNum to set
	 */
	public void setLkdNum(int lkdNum) {
		this.lkdNum = lkdNum;
	}

	/**
	 * @return the loanPurpose
	 */
	public String getLoanPurpose() {
		return loanPurpose;
	}

	/**
	 * @param loanPurpose the loanPurpose to set
	 */
	public void setLoanPurpose(String loanPurpose) {
		this.loanPurpose = loanPurpose;
	}

	/**
	 * @return the maturityDate
	 */
	public Date getMaturityDate() {
		return maturityDate;
	}

	/**
	 * @param maturityDate the maturityDate to set
	 */
	public void setMaturityDate(Date maturityDate) {
		this.maturityDate = maturityDate;
	}

	/**
	 * @return the onUnderInd
	 */
	public int getOnUnderInd() {
		return onUnderInd;
	}

	/**
	 * @param onUnderInd the onUnderInd to set
	 */
	public void setOnUnderInd(int onUnderInd) {
		this.onUnderInd = onUnderInd;
	}

	/**
	 * @return the prAmount
	 */
	public BigDecimal getPrAmount() {
		return prAmount;
	}

	/**
	 * @param prAmount the prAmount to set
	 */
	public void setPrAmount(BigDecimal prAmount) {
		this.prAmount = prAmount;
	}

	/**
	 * @return the processDate
	 */
	public Date getProcessDate() {
		return processDate;
	}

	/**
	 * @param processDate the processDate to set
	 */
	public void setProcessDate(Date processDate) {
		this.processDate = processDate;
	}

	/**
	 * @return the refNo
	 */
	public String getRefNo() {
		return refNo;
	}

	/**
	 * @param refNo the refNo to set
	 */
	public void setRefNo(String refNo) {
		this.refNo = refNo;
	}

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the subProductcode
	 */
	public String getSubProductcode() {
		return subProductcode;
	}

	/**
	 * @param subProductcode the subProductcode to set
	 */
	public void setSubProductcode(String subProductcode) {
		this.subProductcode = subProductcode;
	}

	/**
	 * @return the term
	 */
	public String getTerm() {
		return term;
	}

	/**
	 * @param term the term to set
	 */
	public void setTerm(String term) {
		this.term = term;
	}

	/**
	 * @return the txnDesc
	 */
	public String getTxnDesc() {
		return txnDesc;
	}

	/**
	 * @param txnDesc the txnDesc to set
	 */
	public void setTxnDesc(String txnDesc) {
		this.txnDesc = txnDesc;
	}

	/**
	 * @return the updatedBy
	 */
	public String getUpdatedBy() {
		return updatedBy;
	}

	/**
	 * @param updatedBy the updatedBy to set
	 */
	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	/**
	 * @return the updatedDate
	 */
	public Date getUpdatedDate() {
		return updatedDate;
	}

	/**
	 * @param updatedDate the updatedDate to set
	 */
	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	/**
	 * @return the valueDate
	 */
	public Date getValueDate() {
		return valueDate;
	}

	/**
	 * @param valueDate the valueDate to set
	 */
	public void setValueDate(Date valueDate) {
		this.valueDate = valueDate;
	}

	
	
	

}
